package com.ywb.order.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @Author ywb
 */

@RestController
@RequestMapping("/order")
public class OrderController {

    public static final String PAYMENT_API = "http://payment-service";

    @Resource
    private RestTemplate restTemplate;

    @RequestMapping("/consul")
    public String connect(){
        return restTemplate.getForObject(PAYMENT_API + "/payment/consul", String.class);
    }
}
